package jndi.ldap;

import jndi.ldap.factory.LdapConnectionManager;

import java.util.Hashtable;

import javax.naming.NamingException;
import javax.naming.ldap.Control;
import javax.naming.ldap.InitialLdapContext;

public class LdapConnection extends InitialLdapContext {

    private LdapConnectionManager connectionManager;

    public LdapConnection() throws NamingException {
        super();
    }

    public LdapConnection(Hashtable<?, ?> environment, Control[] connCtls) throws NamingException {
        super(environment, connCtls);
    }

    public LdapConnectionManager getConnectionManager() {
        return connectionManager;
    }

    public void setConnectionManager(LdapConnectionManager connectionManager) {
        this.connectionManager = connectionManager;
    }

    public void close() {
        try {
            super.close();
        } catch (NamingException e) {
            throw new RuntimeException(e);
        }
    }

}
